Skip to content

Add non-invasive nix shell integration#14

Open
sisyphushappy wants to merge 1 commit intokowainik:mainfrom
sisyphushappy:feat-stack-nix-integration
Open

Add non-invasive nix shell integration#14
sisyphushappy wants to merge 1 commit intokowainik:mainfrom
sisyphushappy:feat-stack-nix-integration

Conversation

@sisyphushappy
Copy link
Copy Markdown

@sisyphushappy sisyphushappy commented Aug 17, 2022

Hi @chshersh,

I watched your FunctionalFest presentation about cake-slayer, and I think this is a great project for the Haskell community. The choices you made really seem to address a lot of the reservations I've felt about investing in Haskell for a production application. I am still a Haskell beginner so I'm hoping that by grokking this template project, I can level myself up to proficiency.

Anyway, this change is based on a Tweag blog post, which explains how to integrate Nix with stack in a non-invasive manner.

I tested the change on my NixOS machine by building...

stack build

running the server...

stack run piece-of-cake-slayer

and running the test commands from the readme...

$ curl localhost:8080/items

$ curl -XPOST \
    -H 'Content-Type: application/json' \
    localhost:8080/createItem \
    -d '{"tag": "Item", "text": "New item"}'

$ curl -XPOST \
    -H 'Content-Type: application/json' \
    localhost:8080/deleteItem \
    -d '1'

Finally, I ran the unit tests...

$ stack test
piece-of-cake-slayer> test (suite: piece-of-cake-slayer-test)
                                  

Unit tests
  Database tests
    Item
      Gets all items
      Creates new item
      Deletes item

Finished in 0.0185 seconds
3 examples, 0 failures

piece-of-cake-slayer> Test suite piece-of-cake-slayer-test passed
Completed 9 action(s).

@sisyphushappy sisyphushappy requested a review from vrom911 as a code owner August 17, 2022 03:27
@chshersh
Copy link
Copy Markdown
Contributor

Hi @sisyphushappy, thanks for the kind words about my talk! 😊
However, I'm not maintaining this project anymore.

@sisyphushappy
Copy link
Copy Markdown
Author

No problem, thanks anyway 🙂!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants